package study02;

public class Java03_TwoArrayTest {
    public static void main(String[] args) {
        int row = 9;
        int col = 2 * (row - 1) + 1;
        String[][] yaota = new String[row][col];
        for (int i = 0; i < row; i++) {
            for (int j = 0; j < col; j ++) {
//                列 == 行 - 1 就是中心点
//                0 =》 8
//                0 =》 7 8 9
//                0 =》 6 7 8 9 10
                if ( j >= ( row - 1 ) - i && j <= ( row - 1 ) + i) {
                    yaota[i][j] = "*";
                } else  {
                    yaota[i][j] = " ";
                }
            }
        }
        for (int i = 0; i < row; i++) {
            for (int j = 0; j < col; j ++) {
                System.out.print(yaota[i][j]);;
            }
            System.out.println(" ");
        }
    }
}
